<template>
  <div>
    <h1>{{bodymsg}}</h1>

    <input type="text" v-model="inputval"> <br>

    <button @click="send">发送</button>
  </div>
</template>

<script>
import axios from 'axios'

export default {
  name: 'MyBody',
  props: ['bodymsg'],
  data () {
    return {
      message: '每天好快乐',
      inputval: ''
    }
  },
  watch: {
    inputval: function (newVal) {
      this.$emit('inputdatachange', newVal)
    }
  },
  methods: {
    send () {
      axios.get('http://www.baidu.com')
    }
  }
}
</script>

<style scoped>
div{
  width: 50%;
  height: 400px;
  text-align: center;
  background-color: #AABBCC;
}
</style>
